package com.tyk.bookstore.front.product.repository;


import com.tyk.bookstore.front.common.dal.mapper.IMapper;
import com.tyk.bookstore.front.product.model.dto.ClazzNestDto;
import com.tyk.bookstore.front.product.model.dto.ClazzSimDto;
import com.tyk.bookstore.front.product.model.entity.ClassificationDo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author tyk
 * @description 分类管理
 */
@Mapper
public interface ClassificationRepository extends IMapper<ClassificationDo> {
    List<ClassificationDo> selectListByParentId(@Param("parentId") Long parentId);

    Long selectLevelById(@Param("id") Long id);

    List<Long> selectThirdIdListByFirstId(@Param("firstId") Long firstId);

    List<Long> selectIdListByParentId(@Param("parentId") Long parentId);

    String selectFullNameByThirdId(@Param("thirdId") Long thirdId);

    /**
     * @return 嵌套分类结点列表
     */
    List<ClazzNestDto> selectClazzNestDtoList();

    String selectNameById(@Param("id") Long id);

    Long selectParentIdById(@Param("id") Long id);

    ClazzSimDto selectClassificationSimDtoById(@Param("id") Long id);
}
